package controlLayer;

import java.util.LinkedList;

import modelLayer.Customer;
import dbLayer.IFDBCustomers;
import dbLayer.DBCustomers;

public class CustomerCtr implements IFDBCustomers {

	protected IFDBCustomers dbCustomers;
	public CustomerCtr()
	{
		dbCustomers = new DBCustomers();
	}
	@Override
	public int insertCustomer(Customer customer) throws Exception {
		return dbCustomers.insertCustomer(customer);
	}

	@Override
	public int updateCustomer(Customer customer, Customer newCustomer)
			throws Exception {
		return dbCustomers.updateCustomer(customer, newCustomer);
	}

	@Override
	public int deleteCustomer(Customer customer) throws Exception {
		return dbCustomers.deleteCustomer(customer);
	}

	@Override
	public Customer searchCustomer(Customer customer) throws Exception {
		return dbCustomers.searchCustomer(customer);
	}

	@Override
	public LinkedList<Customer> getAllCustomers() throws Exception {
		return dbCustomers.getAllCustomers();
	}

}
